import Bar from '/@/assets/kanban/bar.png'

/** 尺寸的方案 */
export const KANBAN_RECT_TYPE = {
  custom: { // 自定义尺寸，px
    label: '自定义尺寸',
    value: 'custom'
  },
  ratio: { // 自定义尺寸，px
    label: '比例缩放',
    value: 'ratio'
  },
  auto: { // 自定义尺寸，px
    label: '自适应',
    value: 'auto'
  }
};

/** 尺寸 */
export const DEFAULT_KANBAN_RECT = {
  [KANBAN_RECT_TYPE.ratio.value]: {
    type: KANBAN_RECT_TYPE.ratio.value,
    width: 16,
    height: 9,
    active: true // 选中
  },
  [KANBAN_RECT_TYPE.custom.value]: {
    type: KANBAN_RECT_TYPE.custom.value,
    width: 1920,
    height: 1080
  },
  [KANBAN_RECT_TYPE.auto.value]: {
    type: KANBAN_RECT_TYPE.auto.value,
    width: 100,
    height: 100
  }
};
/** 组件类型 */
export const PANEL_TYPE = {
  baseBar: 'bar'
};

export const DEFAULT_RECT = {
  width: 386,
  height: 256,
  top: 0,
  left: 0
};

export const TOOL_MENUS = [
  {
    icon: 'iconfont icon-Chart',
    label: '图表',
    type: 'echarts',
    data: [
      {
        label: '基础柱状图',
        icon: Bar,
        type: PANEL_TYPE.baseBar
      }
    ]
  }
];

export const TOOL_ACTIONS = [
  { icon: 'iconfont icon-Frame', label: '清空屏幕', type: 'clear' },
  { icon: 'iconfont icon-kanban-preview', label: '预览', type: 'preview' },
  { icon: 'iconfont icon-conserve', label: '保存', type: 'save' }
];

/**
 * 数据表单的配置项
 */
export const FORM_DEFAULT_CONFIG = {
  [PANEL_TYPE.baseBar]: [
    {
      prop: 'title',
      label: '图表标题',
      dom: 'Input',
      formItemProps: {
        labelCol: { span: 24 },
        required: true,
        help: ' '
      },
      columnProps: { span: 24 }
    },
    {
      prop: 'x',
      label: 'X轴',
      dom: 'Input',
      formItemProps: {
        labelCol: { span: 24 },
        required: true
      },
      columnProps: { span: 11 }
    },
    {
      prop: 'y',
      label: 'Y轴',
      dom: 'Input',
      formItemProps: {
        labelCol: { span: 24 },
        required: true
      },
      columnProps: { span: 11, offset: 2 }
    }
  ]
};

export const FORM_DEFAULT_MODEL = {
  [PANEL_TYPE.baseBar]: {
    title: '柱状图',
    x: null,
    y: null
  }
}
